<style>
    .form .label { width:110px; padding-right:15px; }
</style>
<div class="form" style="overflow: auto">
    <?php
    /* @var $model Album */
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'album-form',       
        'enableAjaxValidation'=>false,
        'enableClientValidation'=>true,
        'clientOptions' => array('validateOnSubmit'=>true, 'validateOnType'=>true),
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
         ));
    ?>
    
    <table class="form" style="width: 100%">
        <tr>
            <td class="label required"><?php echo $form->labelEx($model, 'name'); ?></td>
            <td class="input" >
                <?php echo $form->textField($model, 'name', array('style' => 'width:210px', 'placeholder' => t('PLH_ALBUM_NAME', 'gallery'))); ?>
                <?php echo $form->error($model, 'name'); ?>
            </td>
        </tr>
        <tr>
            <td class="label required" style="vertical-align: top;">
		<?php 
		if ($model->scenario == Album::SCENARIO_CREATE) {
		echo $form->labelEx($model, 'picture', array('class' => 'required')). ' *';
		} else {
		    echo $form->labelEx($model, 'picture', array(''));
		}
		?>
		</td>
            <td class="input">
                <?php 
		//echo $form->fileField($model, 'picture', array('style' => 'width:224px',)); ?>
		<input type="file" name="Album[picture]"></input>
                <?php echo $form->error($model, 'picture'); ?>
               
                <?php echo '<br />' . substr($model->picture, strpos($model->picture, '_') + 1); ?>
                <div style="font-size: 13px;">
		    <b>Note</b> </br>		    
1. Allow format type : {"jpg","jpeg","bmp","png","gif"}	 </br>											
2. The file size must be less than or equal 1 MB											

		</div>
            </td>
        </tr>
        <tr>
            <td class="label required"><?php echo $form->labelEx($model, 'status'); ?></td>
            <td class="input">
                 <?php
                echo $form->dropDownList($model, 'status', Html::listData(LGHelpers::getStatusAlbum(), 'id', 'name'));
                ?>
                <?php echo $form->error($model, 'status'); ?>
            </td>
        </tr>
        <tr>
            <td class="label required"><?php echo $form->labelEx($model, 'language'); ?></td>
            <td class="input">
                <?php
                echo $form->dropDownList($model, 'language', Html::listData(Language::model()->findAll(), 'code', 'value'), array(
                    'empty' => array('*' => 'All language')
                        )
                );
                ?>
                <?php echo $form->error($model, 'language'); ?>
            </td>
        </tr>
        <tr>
            <td class="label"><?php echo $form->labelEx($model, 'description'); ?></td>
            <td class="input"><?php echo $form->textArea($model, 'description', array('style' => 'width:215px;height:80px', 'placeholder' => t('PLH_DESCRIPTION', 'gallery'))); ?>
            <?php echo $form->error($model, 'description'); ?></td>
        </tr>


        <tr>
            <td colspan="2" class="cbutton">
                <?php echo Html::buttonConfirm(t('BTN_SAVE'),'btnSave', 'ok', array('type' => 'submit', 'class' => 'button save update-file-dialog-submit-button')) ?>
                <?php echo Html::buttonConfirm(t('BTN_CANCEL'),'albumCanceled', 'cancel'); ?>
            </td>
        </tr>
    </table>    
    <?php $this->endWidget(); ?>
    <script type="text/javascript">
        LGCMS.addTooltip();
    </script>
    
</div><!-- form -->
